import 'package:flutter/material.dart';
import 'package:text_world/global.dart';
import 'package:text_world/pages/card.dart';

class YijuCard extends StatefulWidget {
  YijuCard({Key key, this.hitokoto}) : super(key: key);
  final hitokoto;
  @override
  _YijuCardState createState() => _YijuCardState();
}

class _YijuCardState extends State<YijuCard> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return TCard(
      child: Container(
        width: MediaQuery.of(context).size.width - 100,
        height: MediaQuery.of(context).size.height - 250,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Container(
              width: MediaQuery.of(context).size.width - 100,
              child: FadeInImage.assetNetwork(
                placeholder: 'assets/images/place.jpg',
                fadeInDuration: Duration(milliseconds: 500),
                image: 'https://api.ixiaowai.cn/gqapi/gqapi.php?t=' +
                    DateTime.now().millisecondsSinceEpoch.toString(),
              ),
            ),
            SizedBox(height: 10),
            Expanded(
              child: SingleChildScrollView(
                child: Container(
                  padding: EdgeInsets.all(20),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Stack(
                        children: [
                          Positioned(
                            top: 10,
                            left: 3,
                            child: Container(
                              width: 12,
                              child: Image.asset("assets/images/mei.png"),
                            ),
                          ),
                          Text(
                            "    ${widget.hitokoto['hitokoto']}",
                            style: TextStyle(
                              fontFamily: 'fangzhengkai',
                              fontSize: 19,
                              color: Global.fontColor,
                              fontWeight: FontWeight.w600,
                              height: 1.5,
                            ),
                          ),
                        ],
                      ),
                      SizedBox(height: 50),
                      Text(
                        ' - ${widget.hitokoto['from']} - ',
                        style: TextStyle(
                          fontFamily: 'fangzhengkai',
                          fontSize: 14,
                          color: Global.fontSecondColor,
                          fontWeight: FontWeight.w600,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
            SizedBox(height: 10),
          ],
        ),
      ),
    );
  }
}
